

// Declaring variables to prevent implied global error in jslint
var Ti;

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Ti.UI.setBackgroundColor('#414444');
// Codestrong libraries
Ti.include(
	'cs/cs.js',
	'cs/ui.js',
	'cs/datetime.js'
	
);




// All Codestrong windows
Ti.include(

    'windows/ModalActivityIndicatorWindow.js',
	'windows/LectureBySubject.js',
    'windows/LectureMain.js',
    'windows/AboutMain.js',
    'windows/SettingMain.js',
    'windows/LectureDetail.js',
    'windows/VideoWindow.js',
    
    'windows/ExamMain.js',
    'windows/ExamBySubject.js',
    'windows/ExamDetail.js',
    'windows/CenterMain.js',
    'windows/SocialMain.js',
    'windows/LectureCategory.js',
    'windows/CategoryDownload.js',
    'windows/CategoryDownloadDetail.js',
    'windows/SearchLecture.js',
     
  	// Create icons based on previous custom windows and
  	// load them into the main dashboard window  
  	'cs/icons.js',
  	'windows/main.js',
 	'cs/EventGarbageCollection.js'
);

// Initialize local storage
require('db').createDb();
require('settings').createSettings();


// open (sponsor) URLs in the native browser, not a webview
Ti.App.addEventListener('openURL', function(e){
  	Ti.Platform.openURL(e.url);
});